﻿using System;
using UnityEngine;

namespace GpuHud.Settings
{
    public enum MatGroupType
    {
        Text_FlyText = 1,
        Text_PlayerName = 2,
    }
    
    [Serializable]
    public class MaterialParamsSetting
    {
        /// <summary>
        /// 基础材质,StructedBuffer
        /// </summary>
        [SerializeField]
        private Material m_originMat_SSBO;
        /// <summary>
        /// 基础材质,TextureData
        /// </summary>
        [SerializeField]
        private Material m_originMat_TextureData;

        public Material Mat
        {
            get
            {
                switch (GpuHudFacade.GpuFacade.Context.CurrentRenderMethod)
                {
                    case RenderMethod.GpuInstance:
                        return m_originMat_TextureData;
                    case RenderMethod.StructedBuffer:
                        return m_originMat_SSBO;
                    default:
                        return m_originMat_TextureData;
                }
            }
        }
        
        /// <summary>
        /// 渲染参数组类型,用来确定渲染的基础材质
        /// </summary>
        [SerializeField]
        private MatGroupType m_groupType;
        public MatGroupType GroupType
        {
            get { return m_groupType; }
        }

        /// <summary>
        /// 单次Hud渲染合批Mesh数量
        /// </summary>
        [SerializeField]
        private int m_BatchCount;

        public int BatchCount
        {
            get
            {
                return m_BatchCount;
            }
        }

        public string DebugStr;
    }
}